package com.metaverse.backend.lock;

import com.metaverse.backend.config.RedisLockKey;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author mashaohua
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface RedisLockable {

    RedisLockKey prefix();

    String[] key() default {};

    /**
     * 尝试时间，默认是毫秒
     * @return
     */
    int tryTime() default 0;

    /**
     * 忽略失败
     * @return
     */
    boolean ignoreFail() default false;

}
